﻿#ifndef PARA_BANNER_H
#define PARA_BANNER_H

#include <QFont>
#include <QLabel>
#include <QPainter>
#include <QTimer>
#include <QWidget>

class BlinkLabel : public QLabel {
    Q_OBJECT
public:
    explicit BlinkLabel(QWidget* parent = nullptr, const QColor& color = Qt::red);
    ~BlinkLabel();

protected:
    // 绘制文本
    void paintEvent(QPaintEvent* event);

public slots:
    void alarm(bool isAlarm);

private slots:
    void sltTimeout();

private:
    QTimer timer_;
    QColor set_color_;
    QColor original_color_;
    bool is_alarm_ = false;
    bool is_change_text_color_ = true;
};

#endif
